package com.demo.java.spring.validation;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Controller
@RequestMapping("/validate")
public class ValidateTestController {

    @ResponseBody
    @RequestMapping(value = "/params", method = {RequestMethod.POST})
    public Object validateTest(@RequestBody @Valid UserInfo userInfo) {
        System.out.println("validate test controller, name is: " + userInfo.getName());
        return "{\"status\":\"success\"}";
    }
}
